import java.util.Arrays;

public class Test {
}
class Solution {
    public int countSeniors(String[] details) {
        int cnt = 0;
        for(String x : details){
            if(Integer.parseInt(x.substring(11,13))>60)
                cnt++;
        }
        return cnt;
    }
}
class Solution1 {
    public int maxSatisfaction(int[] satisfaction) {
        Arrays.sort(satisfaction);
        int f = 0;
        int s = 0;
        for(int i=satisfaction.length-1; i>=0; i--){
            s += satisfaction[i];
            if(s <= 0) break;
            f += s;
        }
        return f;
    }
}